<?php

class ApiConfiguration {

	private static $iniArray;
	private static $iniFileName =  'config/settings.ini';
	private static $instance;

    private function __construct() {
        if(!isset(self::$iniArray)) {
			self::$iniArray = parse_ini_file(dirname(__FILE__) . '/' .  self::$iniFileName, 1);
        }
    }

    public static function getInstance() {
        if(!self::$instance)
            self::$instance =  new ApiConfiguration();
        return  self::$instance;
    }

    public function getDataReadDBServer() {
        return self::$iniArray['db_read'];
    }

    public function getDataWriteDBServer() {
        return  self::$iniArray['db_write'];
    }

    public function setConfigurationOption($section, $key, $value) {
        self::$iniArray[$section][$key]=$value;
    }
   
}

?>
